//
//  ZLBaseResourceUtils.h
//
//  Created by Jiaozl on 2021/4/20.
//  
//

#import <Foundation/Foundation.h>

NS_ASSUME_NONNULL_BEGIN

@interface ZLBaseResourceUtils : NSObject

#pragma mark - 需要子类重写zlIOSkit_bundleName方法

/**
 * @brief 获取当前bundle下的图片对象
 */
+ (UIImage *)zlIOSkit_imageWithName:(NSString *)imageName;

/**
 * @brief 获取当前bundle下的json文件
 */
+ (NSString *)zlIOSkit_jsonPathWithName:(NSString *)jsonName;

/**
 * @brief 获取当前bundle下的指定类型的文件
 */
+ (NSString *)zlIOSkit_filePathWithName:(NSString *)fileName ofType:(NSString *)type;

/**
 * @brief 获取当前的bundle
 */
+ (NSBundle *)zlIOSkit_bundle;

#pragma mark - MainBundle资源获取

/**
 * @brief 获取main bundle下的json文件
 */
+ (NSString *)zlIOSkit_jsonPathInMainBundleWithName:(NSString *)jsonName;

#pragma mark -

/**
 @brief 获取指定bundle下的图片对象
 
 @return 如果参数不合法，返回nil对象
 */
+ (UIImage *)zlIOSkit_imageWithName:(NSString *)imageName
                          bundleName:(NSString *)bundleName
                           pathClass:(Class)aClass;

/**
 @brief 获取Json文件的路径
 
 @return 如果参数不合法，返回nil对象
 */
+ (NSString *)zlIOSkit_jsonPathWithName:(NSString *)jsonName
                              bundleName:(NSString *)bundleName
                               pathClass:(Class)aClass;

/**
 @brief 获取制定文件的路径信息
 */
+ (NSString *)zlIOSkit_filePathWithName:(NSString *)fileName
                                  ofType:(NSString *)type
                              bundleName:(NSString *)bundleName
                               pathClass:(Class)aClass;

/**
 @brief 获取Bundle

 @aClass bundle所在的组件内的任意类
 */
+ (NSBundle *)zlIOSkit_bundleWithName:(NSString *)bundleName pathClass:(Class)aClass;

#pragma mark -

/**
 * 获取指定path下json数据
 */
+ (id)jsonDataWithPath:(NSString *)path;

#pragma mark -

/**
 * 需要子类化并重写此方法
 * @return 返回子类所在组件的bundle名称
 */
+ (NSString *)zlIOSkit_bundleName;

@end

NS_ASSUME_NONNULL_END
